/*
 *  Copyright 2012 SerGenis. All rights reserved.
 */
package com.sergenis.swing;

import java.util.Arrays;
import java.util.Collection;

/**
 *
 * @author SerGenis
 */
public final class ListViewModel<E>
    extends javax.swing.DefaultListModel<E> {

    public ListViewModel(java.util.Collection<E> elements) {
	addAll(elements);
    }

    public ListViewModel(E[] elements) {
	this(Arrays.asList(elements));
    }

    public void addAll(Collection<E> c) {
	for (E elmnt : c) super.addElement(elmnt);
    }

    public void addAll(int index, Collection<E> c) {
	for (E elmnt : c) super.add(index++, elmnt);
    }
}
